package com.pwt.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author dw
 * @date 2021/12/28 0:38
 * @Description
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "大屏返回数据模型")
public class DiagramModel {

    @Schema(description = "主键id")
    private Integer  id;

    @Schema(description = "名称")
    private  String name;

    @Schema(description = "订单编号")
    private  String orderId;

    @Schema(description = "生产单元数量")
    private Integer numberOfParts= 0;

    @Schema(description = "数量值")
    private Integer count = 0;

    @Schema(description = "合格数量")
    private Integer qualified = 0;

    @Schema(description = "合格率")
    private BigDecimal qualifiedRate;

    @Schema(description = "有合格的被测参数")
    private Integer hasQualified = 0;

    @Schema(description = "有合格的被测参数比率")
    private BigDecimal hasQualifiedRate;

    @Schema(description = "不合格数量")
    private Integer disqualification = 0 ;

    @Schema(description = "不合格率")
    private BigDecimal disqualificationRate;


    public DiagramModel(DiagramModel model) {
        this.id = model.getId();
        this.name = model.getName();
        this.orderId = model.getOrderId();
        this.numberOfParts = model.getNumberOfParts();
        this.count = model.getCount();
        this.qualified = model.getQualified();
        this.qualifiedRate = model.getQualifiedRate();
        this.hasQualified = model.getHasQualified();
        this.hasQualifiedRate = model.getHasQualifiedRate();
        this.disqualification = model.getDisqualification();
        this.disqualificationRate = model.getDisqualificationRate();
    }
}
